import { Module, forwardRef } from '@nestjs/common';
import { UserService } from './user.service';
import { UserController } from './user.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from '../../entities/user.entity';
import { CommonModule } from '../../common/common.module';
import { AuthModule } from '../../core/auth/auth.module';
import { PassportModule } from '@nestjs/passport';
import { LocalStrategy } from '../../core/auth/local.strategy';
import { Role } from '../../entities/role.entity';
import { DictService } from '../dict/dict.service';
import { DictModule } from '../dict/dict.module';
import { RoleModule } from '../role/role.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([User, Role]),
    forwardRef(() => AuthModule), // 处理相互循环依赖
    CommonModule,
    PassportModule,
    DictModule,
    RoleModule,
  ],
  controllers: [UserController],
  providers: [UserService],
  exports: [UserService],
})
export class UserModule {}
